home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
8352
/
8352.xpi
/
chrome
/
greasefire.jar
/
content
/
test
/
test_picker.js
< prev
next >
Wrap
Text File
|
2009-01-06
|
1KB
|
42 lines
/*
* Copyright (C) 2008 by Steve Krulewitz <skrulx@gmail.com>
* Licensed under GPLv2 or later, see file LICENSE in the xpi for details.
*/
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
function runTest() {
var gfs = Cc["@skrul.com/greasefire/service;1"]
.getService(Ci.gfIGreasefireService);
var uri = newURI("http://www.google.com");
var results = gfs.search(uri);
var params = Cc["@mozilla.org/embedcomp/dialogparam;1"]
.createInstance(Ci.nsIDialogParamBlock);
var array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
array.appendElement(results, false);
array.appendElement(uri, false);
params.objects = array;
const ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Ci.nsIWindowWatcher);
ww.openWindow(null,
"chrome://greasefire/content/picker.xul",
"_blank",
"chrome,all,dialog,modal,dialog=no",
params);
return true;
}
function newURI(spec) {
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
return ioService.newURI(spec, null, null);
}